package com.yuanheng100.ems4j.common.constant;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by j4love on 2016/12/13.
 * Description : 员工状态
 */
public enum EmployeeStatus
{

    WORKING((short) 1, "在职"),
    VACATION((short) 2, "休假"),
    QUIT((short) 3, "离职");


    private Short code;
    private String name;


    private static Map<Short, EmployeeStatus> statusMap = new HashMap<Short, EmployeeStatus>();
    private static List<Map<String,Object>>  statusList = new ArrayList<Map<String, Object>>();

    static
    {
        for (EmployeeStatus employeeStatus : EmployeeStatus.values())
        {
            statusMap.put(employeeStatus.code, employeeStatus);
            Map<String,Object> map = new HashMap<String, Object>();
            map.put("code",employeeStatus.code);
            map.put("name",employeeStatus.name);
            statusList.add(map);
        }

    }

    private EmployeeStatus(Short code, String name)
    {
        this.code = code;
        this.name = name;
    }

    public Short getCode()
    {
        return code;
    }

    public String getName()
    {
        return name;
    }

    public static Map<Short, EmployeeStatus> getStatusMap()
    {
        return statusMap;
    }

    public static List<Map<String, Object>> getStatusList()
    {
        return statusList;
    }
}
